package com.cg.design.depthdesign.builder.builders;

import com.cg.design.depthdesign.builder.cars.CarType;
import com.cg.design.depthdesign.builder.cars.Manual;
import com.cg.design.depthdesign.builder.components.Engine;
import com.cg.design.depthdesign.builder.components.GPSNavigator;
import com.cg.design.depthdesign.builder.components.Transmission;
import com.cg.design.depthdesign.builder.components.TripComputer;

/**
 * 汽车手册生成器
 * <p>
 * 具体生成器类将遵循生成器接口并提供生成步骤的具体实现。
 *
 * @program: LeetCode->CarManualBuilder
 * @author: cg
 * @create: 2022-05-08 16:10
 **/
public class CarManualBuilder implements Builder {

    /**
     * 汽车类型
     */
    private CarType type;
    /**
     * 汽车座位的数量
     */
    private int seats;
    /**
     * 汽车发动机
     */
    private Engine engine;
    /**
     * 汽车变速器
     */
    private Transmission transmission;
    /**
     * 行车电脑
     */
    private TripComputer tripComputer;
    /**
     * 全球定位系统
     */
    private GPSNavigator gpsNavigator;

    @Override
    public void setCarType(CarType type) {
        this.type = type;
    }

    @Override
    public void setSeats(int seats) {
        this.seats = seats;
    }

    @Override
    public void setEngine(Engine engine) {
        this.engine = engine;
    }

    @Override
    public void setTransmission(Transmission transmission) {
        this.transmission = transmission;
    }

    @Override
    public void setTripComputer(TripComputer tripComputer) {
        this.tripComputer = tripComputer;
    }

    @Override
    public void setGPSNavigator(GPSNavigator gpsNavigator) {
        this.gpsNavigator = gpsNavigator;
    }

    public Manual getResult() {
        return new Manual(type, seats, engine, transmission, tripComputer, gpsNavigator);
    }

}
